package
{
	import com.bit101.components.Accordion;
	import com.bit101.components.Calendar;
	import com.bit101.components.CheckBox;
	import com.bit101.components.ColorChooser;
	import com.bit101.components.ComboBox;
	import com.bit101.components.FPSMeter;
	import com.bit101.components.HBox;
	import com.bit101.components.HRangeSlider;
	import com.bit101.components.HScrollBar;
	import com.bit101.components.HSlider;
	import com.bit101.components.HUISlider;
	import com.bit101.components.IndicatorLight;
	import com.bit101.components.InputText;
	import com.bit101.components.Knob;
	import com.bit101.components.Label;
	import com.bit101.components.List;
	import com.bit101.components.ListItem;
	import com.bit101.components.Meter;
	import com.bit101.components.NumericStepper;
	import com.bit101.components.Panel;
	import com.bit101.components.ProgressBar;
	import com.bit101.components.PushButton;
	import com.bit101.components.RadioButton;
	import com.bit101.components.RangeSlider;
	import com.bit101.components.RotarySelector;
	import com.bit101.components.ScrollBar;
	import com.bit101.components.ScrollPane;
	import com.bit101.components.Slider;
	import com.bit101.components.Style;
	import com.bit101.components.Text;
	import com.bit101.components.TextArea;
	import com.bit101.components.Tree;
	import com.bit101.components.VBox;
	import com.bit101.components.VRangeSlider;
	import com.bit101.components.VScrollBar;
	import com.bit101.components.VSlider;
	import com.bit101.components.VUISlider;
	import com.bit101.components.Window;

	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;

	import avmplus.getQualifiedClassName;

	/**
	 *
	 * @author feng 2016-3-21
	 */
	public class minimalcomps_examples extends Sprite
	{
		public function minimalcomps_examples()
		{
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			stage.color = 0;

			MyCC.initFlashConsole(this);

			initStyles();
			init();
		}

		private function init():void
		{
			var clsList:Array = [ //
				Accordion, //
				Calendar, //
				CheckBox, //
				ColorChooser, //
				ComboBox, //
				FPSMeter, //
				HBox, //
				HRangeSlider, //
				HScrollBar, //
				HSlider, //
				HUISlider, //
				IndicatorLight, //
				InputText, //
				Knob, //
				Label, //
				List, //
				ListItem, //
				Meter, //
				NumericStepper, //
				Panel, //
				ProgressBar, //
				PushButton, //
				RadioButton, //
				RangeSlider, //
				RotarySelector, //
				ScrollBar, //
				ScrollPane, //
				Slider, //
//				Style,//
				Text, //
				TextArea, //
//				UISlider,//
				VBox, //
				VRangeSlider, //
				VScrollBar, //
				VSlider, //
				VUISlider, //
//				WheelMenu,//
				Window,//
				];

			var vbox:VBox = new VBox();
			addChild(vbox);

			var hbox:HBox;

			for (var i:int = 0; i < clsList.length; i++)
			{
				if (i % 5 == 0)
				{
					hbox = new HBox();
					vbox.addChild(hbox);
				}

				var cls:Class = clsList[i];
				var itemVBox:VBox = new VBox();
				itemVBox.width = 100;
				itemVBox.addChild(new Label(null,0,0,getQualifiedClassName(cls)));
				itemVBox.addChild(new cls());
				hbox.addChild(itemVBox);
			}
		}

		//	----------------------------------------------------------------
		//	PRIVATE METHODS
		//	----------------------------------------------------------------
		private function initStyles():void
		{
			Style.setStyle(Style.DARK);

			Style.embedFonts = false;
			Style.fontSize = 12;

			Style.PANEL = 0x333333;
			Style.BACKGROUND = 0x333333;
			Style.INPUT_TEXT = 0xEEEEEE;
			Style.LABEL_TEXT = 0xEEEEEE;
			Style.BUTTON_FACE = 0x555555;
			Style.DROPSHADOW = 0x000000;
			Style.LIST_ALTERNATE = 0x333333;
		}

	}
}

